home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / bwidow.c < prev    next >
Text File  |  2000-05-13  |  29KB  |  821 lines

  1. /***************************************************************************
  2.  
  3. Black Widow memory map (preliminary)
  4.  
  5. 0000-04ff RAM
  6. 0800      COIN_IN
  7. 0a00      IN1
  8. 0c00      IN2
  9.  
  10. 2000-27ff Vector generator RAM
  11. 5000-7fff ROM
  12.  
  13.  * Black Widow cannot use the the earom routines
  14.  * She writes into some locations at $2fac-$2fd7, which is clearly
  15.  * the vector rom. Perhaps there is some address-logic that is not yet
  16.  * emulated
  17.  
  18.  
  19. BLACK WIDOW SWITCH SETTINGS (Atari, 1983)
  20. -----------------------------------------
  21.  
  22. -------------------------------------------------------------------------------
  23. Settings of 8-Toggle Switch on Black Widow CPU PCB (at D4)
  24.  8   7   6   5   4   3   2   1   Option
  25. -------------------------------------------------------------------------------
  26. Off Off                          1 coin/1 credit <
  27. On  On                           1 coin/2 credits
  28. On  Off                          2 coins/1 credit
  29. Off On                           Free play
  30.  
  31.         Off Off                  Right coin mechanism x 1 <
  32.         On  Off                  Right coin mechanism x 4
  33.         Off On                   Right coin mechanism x 5
  34.         On  On                   Right coin mechanism x 6
  35.  
  36.                 Off              Left coin mechanism x 1 <
  37.                 On               Left coin mechanism x 2
  38.  
  39.                     Off Off Off  No bonus coins (0)* <
  40.                     Off On  On   No bonus coins (6)
  41.                     On  On  On   No bonus coins (7)
  42.  
  43.                     On  Off Off  For every 2 coins inserted,
  44.                                  logic adds 1 more coin (1)
  45.                     Off On  Off  For every 4 coins inserted,
  46.                                  logic adds 1 more coin (2)
  47.                     On  On  Off  For every 4 coins inserted,
  48.                                  logic adds 2 more coins (3)
  49.                     Off Off On   For every 5 coins inserted,
  50.                                  logic adds 1 more coin (4)
  51.                     On  Off On   For every 3 coins inserted,
  52.                                  logic adds 1 more coin (5)
  53.  
  54. -------------------------------------------------------------------------------
  55.  
  56. * The numbers in parentheses will appear on the BONUS ADDER line in the
  57.   Operator Information Display (Figure 2-1) for these settings.
  58. < Manufacturer's recommended setting
  59.  
  60. -------------------------------------------------------------------------------
  61. Settings of 8-Toggle Switch on Black Widow CPU PCB (at B4)
  62.  8   7   6   5   4   3   2   1   Option
  63.  
  64. Note: The bits are the exact opposite of the switch numbers - switch 8 is bit 0.
  65. -------------------------------------------------------------------------------
  66. Off Off                          Maximum start at level 13
  67. On  Off                          Maximum start at level 21 <
  68. Off On                           Maximum start at level 37
  69. On  On                           Maximum start at level 53
  70.  
  71.         Off Off                  3 spiders per game <
  72.         On  Off                  4 spiders per game
  73.         Off On                   5 spiders per game
  74.         On  On                   6 spiders per game
  75.  
  76.                 Off Off          Easy game play
  77.                 On  Off          Medium game play <
  78.                 Off On           Hard game play
  79.                 On  On           Demonstration mode
  80.  
  81.                         Off Off  Bonus spider every 20,000 points <
  82.                         On  Off  Bonus spider every 30,000 points
  83.                         Off On   Bonus spider every 40,000 points
  84.                         On  On   No bonus
  85.  
  86. -------------------------------------------------------------------------------
  87.  
  88. < Manufacturer's recommended setting
  89.  
  90.  
  91. GRAVITAR SWITCH SETTINGS (Atari, 1982)
  92. --------------------------------------
  93.  
  94. -------------------------------------------------------------------------------
  95. Settings of 8-Toggle Switch on Gravitar PCB (at B4)
  96.  8   7   6   5   4   3   2   1   Option
  97. -------------------------------------------------------------------------------
  98. Off On                           Free play
  99. On  On                           1 coin for 2 credits
  100. Off Off                          1 coin for 1 credit <
  101. On  Off                          2 coins for 1 credit
  102.  
  103.         Off Off                  Right coin mechanism x 1 <
  104.         On  Off                  Right coin mechanism x 4
  105.         Off On                   Right coin mechanism x 5
  106.         On  On                   Right coin mechanism x 6
  107.  
  108.                 Off              Left coin mechanism x 1 <
  109.                 On               Left coin mechanism x 2
  110.  
  111.                     Off Off Off  No bonus coins <
  112.  
  113.                     Off On  Off  For every 4 coins inserted,
  114.                                  logic adds 1 more coin
  115.                     On  On  Off  For every 4 coins inserted,
  116.                                  logic adds 2 more coins
  117.                     Off Off On   For every 5 coins inserted,
  118.                                  logic adds 1 more coin
  119.                     On  Off On   For every 3 coins inserted,
  120.                                  logic adds 1 more coin
  121.  
  122.                     Off On  On   No bonus coins
  123.                     On  Off Off  ??? (not in manual!)
  124.                     On  On  On   No bonus coins
  125.  
  126. -------------------------------------------------------------------------------
  127.  
  128. < Manufacturer's recommended setting
  129.  
  130. -------------------------------------------------------------------------------
  131. Settings of 8-Toggle Switch on Gravitar PCB (at D4)
  132.  8   7   6   5   4   3   2   1   Option
  133. -------------------------------------------------------------------------------
  134.                         On  On   No bonus
  135.                         Off Off  Bonus ship every 10,000 points <
  136.  d   d               d  On  Off  Bonus ship every 20,000 points
  137.  e   e               e  Off On   Bonus ship every 30,000 points
  138.  s   s               s
  139.  U   U          On   U           Easy game play <
  140.                 Off              Hard game play
  141.  t   t               t
  142.  o   o  Off Off      o           3 ships per game
  143.  N   N  On  Off      N           4 ships per game <
  144.         Off On                   5 ships per game
  145.         On  On                   6 ships per game
  146.  
  147. -------------------------------------------------------------------------------
  148.  
  149. < Manufacturer's recommended setting
  150.  
  151. Space Duel Settings
  152. -------------------
  153.  
  154. (Settings of 8-Toggle Switch on Space Duel game PCB at D4)
  155. Note: The bits are the exact opposite of the switch numbers - switch 8 is bit 0.
  156.  
  157.  8   7   6   5   4   3   2   1       Option
  158. On  Off                         3 ships per game
  159. Off Off                         4 ships per game $
  160. On  On                          5 ships per game
  161. Off On                          6 ships per game
  162.         On  Off                *Easy game difficulty
  163.         Off Off                 Normal game difficulty $
  164.         On  On                  Medium game difficulty
  165.         Off On                  Hard game difficulty
  166.                 Off Off         English $
  167.                 On  Off         German
  168.                 On  On          Spanish
  169.                 Off On          French
  170.                                 Bonus life granted every:
  171.                         Off On  8,000 points
  172.                         Off Off 10,000 points
  173.                         On  Off 15,000 points
  174.                         On  On  No bonus life
  175.  
  176. $Manufacturer's suggested settings
  177. *Easy-In the beginning of the first wave, 3 targets appear on the
  178. screen.  Targets increase by one in each new wave.
  179. Normal-Space station action is the same as 'Easy'.  Fighter action has
  180. 4 targets in the beginning of the first wave.  Targets increase by 2
  181. in each new wave.  Targets move faster and more targets enter.
  182. Medium and Hard-In the beginning of the first wave, 4 targets appear
  183. on the screen.  Targets increase by 2 in each new wave.  As difficulty
  184. increases, targets move faster, and more targets enter.
  185.  
  186.  
  187. (Settings of 8-Toggle Switch on Space Duel game PCB at B4)
  188.  8   7   6   5   4   3   2   1       Option
  189. Off On                          Free play
  190. Off Off                        *1 coin for 1 game (or 1 player) $
  191. On  On                          1 coin for 2 game (or 2 players)
  192. On  Off                         2 coins for 1 game (or 1 player)
  193.         Off Off                 Right coin mech x 1 $
  194.         On  Off                 Right coin mech x 4
  195.         Off On                  Right coin mech x 5
  196.         On  On                  Right coin mech x 6
  197.                 Off             Left coin mech x 1 $
  198.                 On              Left coin mech x 2
  199.                     Off Off Off No bonus coins $
  200.                     Off On  Off For every 4 coins, game logic adds 1 more coin
  201.                     On  On  Off For every 4 coins, game logic adds 2 more coin
  202.                     Off On  On  For every 5 coins, game logic adds 1 more coin
  203.                     On  Off On**For every 3 coins, game logic adds 1 more coin
  204.  
  205. $Manufacturer's suggested settings
  206.  
  207. **In operator Information Display, this option displays same as no bonus.
  208.  
  209. ***************************************************************************/
  210.  
  211. #include "driver.h"
  212. #include "vidhrdw/generic.h"
  213. #include "vidhrdw/vector.h"
  214. #include "vidhrdw/avgdvg.h"
  215. #include "machine/atari_vg.h"
  216.  
  217.  
  218. #define IN_LEFT    (1 << 0)
  219. #define IN_RIGHT (1 << 1)
  220. #define IN_FIRE (1 << 2)
  221. #define IN_SHIELD (1 << 3)
  222. #define IN_THRUST (1 << 4)
  223. #define IN_P1 (1 << 5)
  224. #define IN_P2 (1 << 6)
  225.  
  226. /*
  227.  
  228. These 7 memory locations are used to read the 2 players' controls as well
  229. as sharing some dipswitch info in the lower 4 bits pertaining to coins/credits
  230. Typically, only the high 2 bits are read.
  231.  
  232. */
  233.  
  234. static READ_HANDLER( spacduel_IN3_r ) {
  235.  
  236.     int res;
  237.     int res1;
  238.     int res2;
  239.  
  240.     res1 = readinputport(3);
  241.     res2 = readinputport(4);
  242.     res = 0x00;
  243.  
  244.     switch (offset & 0x07) {
  245.         case 0:
  246.             if (res1 & IN_SHIELD) res |= 0x80;
  247.             if (res1 & IN_FIRE) res |= 0x40;
  248.             break;
  249.         case 1: /* Player 2 */
  250.             if (res2 & IN_SHIELD) res |= 0x80;
  251.             if (res2 & IN_FIRE) res |= 0x40;
  252.             break;
  253.         case 2:
  254.             if (res1 & IN_LEFT) res |= 0x80;
  255.             if (res1 & IN_RIGHT) res |= 0x40;
  256.             break;
  257.         case 3: /* Player 2 */
  258.             if (res2 & IN_LEFT) res |= 0x80;
  259.             if (res2 & IN_RIGHT) res |= 0x40;
  260.             break;
  261.         case 4:
  262.             if (res1 & IN_THRUST) res |= 0x80;
  263.             if (res1 & IN_P1) res |= 0x40;
  264.             break;
  265.         case 5:  /* Player 2 */
  266.             if (res2 & IN_THRUST) res |= 0x80;
  267.             break;
  268.         case 6:
  269.             if (res1 & IN_P2) res |= 0x80;
  270.             break;
  271.         case 7:
  272.             res = (0x00 /* upright */ | (0 & 0x40));
  273.             break;
  274.         }
  275.     return res;
  276.     }
  277.  
  278. READ_HANDLER( bzone_IN0_r );
  279.  
  280. WRITE_HANDLER( bwidow_misc_w )
  281. {
  282.     /*
  283.         0x10 = p1 led
  284.         0x20 = p2 led
  285.         0x01 = coin counter 1
  286.         0x02 = coin counter 2
  287.     */
  288.     static int lastdata;
  289.  
  290.     if (data == lastdata) return;
  291.     osd_led_w (0, ~((data & 0x10) >> 4));
  292.     osd_led_w (1, ~((data & 0x20) >> 5));
  293.     coin_counter_w (0, data & 0x01);
  294.     coin_counter_w (1, data & 0x02);
  295.     lastdata = data;
  296. }
  297.  
  298.  
  299. static struct MemoryReadAddress bwidow_readmem[] =
  300. {
  301.     { 0x0000, 0x07ff, MRA_RAM },
  302.     { 0x2000, 0x27ff, MRA_RAM },
  303.     { 0x2800, 0x5fff, MRA_ROM },
  304.     { 0x6000, 0x600f, pokey1_r },
  305.     { 0x6800, 0x680f, pokey2_r },
  306.     { 0x7000, 0x7000, atari_vg_earom_r },
  307.     { 0x7800, 0x7800, bzone_IN0_r },    /* IN0 */
  308.     { 0x8000, 0x8000, input_port_3_r },    /* IN1 */
  309.     { 0x8800, 0x8800, input_port_4_r },    /* IN1 */
  310.     { 0x9000, 0xffff, MRA_ROM },
  311.     { -1 }    /* end of table */
  312. };
  313.  
  314. static struct MemoryWriteAddress bwidow_writemem[] =
  315. {
  316.     { 0x0000, 0x07ff, MWA_RAM },
  317.     { 0x2000, 0x27ff, MWA_RAM, &vectorram, &vectorram_size },
  318.     { 0x2800, 0x5fff, MWA_ROM },
  319.     { 0x6000, 0x67ff, pokey1_w },
  320.     { 0x6800, 0x6fff, pokey2_w },
  321.     { 0x8800, 0x8800, bwidow_misc_w }, /* coin counters, leds */
  322.     { 0x8840, 0x8840, avgdvg_go_w },
  323.     { 0x8880, 0x8880, avgdvg_reset_w },
  324.     { 0x88c0, 0x88c0, MWA_NOP }, /* interrupt acknowledge */
  325.     { 0x8900, 0x8900, atari_vg_earom_ctrl_w },
  326.     { 0x8940, 0x897f, atari_vg_earom_w },
  327.     { 0x8980, 0x89ed, MWA_NOP }, /* watchdog clear */
  328.     { 0x9000, 0xffff, MWA_ROM },
  329.     { -1 }    /* end of table */
  330. };
  331.  
  332. static struct MemoryReadAddress spacduel_readmem[] =
  333. {
  334.     { 0x0000, 0x03ff, MRA_RAM },
  335.     { 0x0800, 0x0800, bzone_IN0_r },    /* IN0 */
  336.     { 0x0900, 0x0907, spacduel_IN3_r },    /* IN1 */
  337.     { 0x0a00, 0x0a00, atari_vg_earom_r },
  338.     { 0x1000, 0x100f, pokey1_r },
  339.     { 0x1400, 0x140f, pokey2_r },
  340.     { 0x2000, 0x27ff, MRA_RAM },
  341.     { 0x2800, 0x3fff, MRA_ROM },
  342.     { 0x4000, 0x8fff, MRA_ROM },
  343.     { 0xf000, 0xffff, MRA_ROM },
  344.     { -1 }    /* end of table */
  345. };
  346.  
  347. static struct MemoryWriteAddress spacduel_writemem[] =
  348. {
  349.     { 0x0000, 0x03ff, MWA_RAM },
  350.     { 0x0905, 0x0906, MWA_NOP }, /* ignore? */
  351. //    { 0x0c00, 0x0c00, coin_counter_w }, /* coin out */
  352.     { 0x0c80, 0x0c80, avgdvg_go_w },
  353.     { 0x0d00, 0x0d00, MWA_NOP }, /* watchdog clear */
  354.     { 0x0d80, 0x0d80, avgdvg_reset_w },
  355.     { 0x0e00, 0x0e00, MWA_NOP }, /* interrupt acknowledge */
  356.     { 0x0e80, 0x0e80, atari_vg_earom_ctrl_w },
  357.     { 0x0f00, 0x0f3f, atari_vg_earom_w },
  358.     { 0x1000, 0x13ff, pokey1_w },
  359.     { 0x1400, 0x17ff, pokey2_w },
  360.     { 0x2000, 0x27ff, MWA_RAM, &vectorram, &vectorram_size },
  361.     { 0x2800, 0x3fff, MWA_ROM },
  362.     { 0x4000, 0x8fff, MWA_ROM },
  363.     { 0xf000, 0xffff, MWA_ROM },
  364.     { -1 }    /* end of table */
  365. };
  366.  
  367. INPUT_PORTS_START( bwidow )
  368.     PORT_START    /* IN0 */
  369.     PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_COIN1)
  370.     PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_COIN2)
  371.     PORT_BIT ( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED)
  372.     PORT_SERVICE( 0x10, IP_ACTIVE_LOW )
  373.     PORT_BITX( 0x20, IP_ACTIVE_LOW, IPT_SERVICE, "Diagnostic Step", KEYCODE_F1, IP_JOY_NONE )
  374.     /* bit 6 is the VG HALT bit. We set it to "low" */
  375.     /* per default (busy vector processor). */
  376.     PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  377.     /* bit 7 is tied to a 3khz clock */
  378.     PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  379.  
  380.     PORT_START    /* DSW0 */
  381.     PORT_DIPNAME(0x03, 0x00, DEF_STR( Coinage ) )
  382.     PORT_DIPSETTING (  0x01, DEF_STR( 2C_1C ) )
  383.     PORT_DIPSETTING (  0x00, DEF_STR( 1C_1C ) )
  384.     PORT_DIPSETTING (  0x03, DEF_STR( 1C_2C ) )
  385.     PORT_DIPSETTING (  0x02, DEF_STR( Free_Play ) )
  386.     PORT_DIPNAME(0x0c, 0x00, DEF_STR( Coin_B ) )
  387.     PORT_DIPSETTING (  0x00, "*1" )
  388.     PORT_DIPSETTING (  0x04, "*4" )
  389.     PORT_DIPSETTING (  0x08, "*5" )
  390.     PORT_DIPSETTING (  0x0c, "*6" )
  391.     PORT_DIPNAME(0x10, 0x00, DEF_STR( Coin_A ) )
  392.     PORT_DIPSETTING (  0x00, "*1" )
  393.     PORT_DIPSETTING (  0x10, "*2" )
  394.     PORT_DIPNAME(0xe0, 0x00, "Bonus Coins" )
  395.     PORT_DIPSETTING (  0x00, "None" )
  396.     PORT_DIPSETTING (  0x20, "3 credits/2 coins" )
  397.     PORT_DIPSETTING (  0x40, "5 credits/4 coins" )
  398.     PORT_DIPSETTING (  0x60, "6 credits/4 coins" )
  399.     PORT_DIPSETTING (  0x80, "6 credits/6 coins" )
  400.     PORT_DIPSETTING (  0xa0, "4 credits/3 coins" )
  401.  
  402.     PORT_START    /* DSW1 */
  403.     PORT_DIPNAME(0x03, 0x01, "Max Start" )
  404.     PORT_DIPSETTING (  0x00, "Lev 13" )
  405.     PORT_DIPSETTING (  0x01, "Lev 21" )
  406.     PORT_DIPSETTING (  0x02, "Lev 37" )
  407.     PORT_DIPSETTING (  0x03, "Lev 53" )
  408.     PORT_DIPNAME(0x0c, 0x00, DEF_STR( Lives ) )
  409.     PORT_DIPSETTING (  0x00, "3" )
  410.     PORT_DIPSETTING (  0x04, "4" )
  411.     PORT_DIPSETTING (  0x08, "5" )
  412.     PORT_DIPSETTING (  0x0c, "6" )
  413.     PORT_DIPNAME(0x30, 0x10, DEF_STR( Difficulty ) )
  414.     PORT_DIPSETTING (  0x00, "Easy" )
  415.     PORT_DIPSETTING (  0x10, "Medium" )
  416.     PORT_DIPSETTING (  0x20, "Hard" )
  417.     PORT_DIPSETTING (  0x30, "Demo" )
  418.     PORT_DIPNAME(0xc0, 0x00, DEF_STR( Bonus_Life ) )
  419.     PORT_DIPSETTING (  0x00, "20000" )
  420.     PORT_DIPSETTING (  0x40, "30000" )
  421.     PORT_DIPSETTING (  0x80, "40000" )
  422.     PORT_DIPSETTING (  0xc0, "None" )
  423.  
  424.     PORT_START    /* IN3 - Movement joystick */
  425.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT | IPF_8WAY )
  426.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT  | IPF_8WAY )
  427.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN  | IPF_8WAY )
  428.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP    | IPF_8WAY )
  429.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
  430.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
  431.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  432.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  433.  
  434.     PORT_START    /* IN4 - Firing joystick */
  435.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT | IPF_8WAY )
  436.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT  | IPF_8WAY )
  437.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN  | IPF_8WAY )
  438.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP    | IPF_8WAY )
  439.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
  440.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
  441.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  442.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  443. INPUT_PORTS_END
  444.  
  445.  
  446. INPUT_PORTS_START( gravitar )
  447.     PORT_START    /* IN0 */
  448.     PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_COIN1)
  449.     PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_COIN2)
  450.     PORT_BIT ( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED)
  451.     PORT_SERVICE( 0x10, IP_ACTIVE_LOW )
  452.     PORT_BITX( 0x20, IP_ACTIVE_LOW, IPT_SERVICE, "Diagnostic Step", KEYCODE_F1, IP_JOY_NONE )
  453.     /* bit 6 is the VG HALT bit. We set it to "low" */
  454.     /* per default (busy vector processor). */
  455.     PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  456.     /* bit 7 is tied to a 3khz clock */
  457.     PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  458.  
  459.     PORT_START    /* DSW0 */
  460.     PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNUSED )
  461.     PORT_DIPNAME(0x0c, 0x04, DEF_STR( Lives ) )
  462.     PORT_DIPSETTING (  0x00, "3" )
  463.     PORT_DIPSETTING (  0x04, "4" )
  464.     PORT_DIPSETTING (  0x08, "5" )
  465.     PORT_DIPSETTING (  0x0c, "6" )
  466.     PORT_DIPNAME(0x10, 0x00, DEF_STR( Difficulty ) )
  467.     PORT_DIPSETTING (  0x00, "Easy" )
  468.     PORT_DIPSETTING (  0x10, "Hard" )
  469.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
  470.     PORT_DIPNAME(0xc0, 0x00, DEF_STR( Bonus_Life ) )
  471.     PORT_DIPSETTING (  0x00, "10000" )
  472.     PORT_DIPSETTING (  0x40, "20000" )
  473.     PORT_DIPSETTING (  0x80, "30000" )
  474.     PORT_DIPSETTING (  0xc0, "None" )
  475.  
  476.     PORT_START    /* DSW1 */
  477.     PORT_DIPNAME(0x03, 0x00, DEF_STR( Coinage ) )
  478.     PORT_DIPSETTING (  0x01, DEF_STR( 2C_1C ) )
  479.     PORT_DIPSETTING (  0x00, DEF_STR( 1C_1C ) )
  480.     PORT_DIPSETTING (  0x03, DEF_STR( 1C_2C ) )
  481.     PORT_DIPSETTING (  0x02, DEF_STR( Free_Play ) )
  482.     PORT_DIPNAME(0x0c, 0x00, DEF_STR( Coin_B ) )
  483.     PORT_DIPSETTING (  0x00, "*1" )
  484.     PORT_DIPSETTING (  0x04, "*4" )
  485.     PORT_DIPSETTING (  0x08, "*5" )
  486.     PORT_DIPSETTING (  0x0c, "*6" )
  487.     PORT_DIPNAME(0x10, 0x00, DEF_STR( Coin_A ) )
  488.     PORT_DIPSETTING (  0x00, "*1" )
  489.     PORT_DIPSETTING (  0x10, "*2" )
  490.     PORT_DIPNAME(0xe0, 0x00, "Bonus Coins" )
  491.     PORT_DIPSETTING (  0x00, "None" )
  492.     PORT_DIPSETTING (  0x20, "3 credits/2 coins" )
  493.     PORT_DIPSETTING (  0x40, "5 credits/4 coins" )
  494.     PORT_DIPSETTING (  0x60, "6 credits/4 coins" )
  495.     PORT_DIPSETTING (  0x80, "6 credits/6 coins" )
  496.     PORT_DIPSETTING (  0xa0, "4 credits/3 coins" )
  497.  
  498.     PORT_START    /* IN3 - Player 1 */
  499.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 )
  500.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
  501.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  502.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_2WAY )
  503.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
  504.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
  505.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  506.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  507.  
  508.     PORT_START    /* IN4 - Player 2 */
  509.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  510.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  511.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_PLAYER2 | IPF_2WAY )
  512.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_PLAYER2 | IPF_2WAY )
  513.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2 )
  514.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
  515.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  516.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  517. INPUT_PORTS_END
  518.  
  519.  
  520. INPUT_PORTS_START( spacduel )
  521.     PORT_START    /* IN0 */
  522.     PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_COIN1)
  523.     PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_COIN2)
  524.     PORT_BIT ( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED)
  525.     PORT_SERVICE( 0x10, IP_ACTIVE_LOW )
  526.     PORT_BITX( 0x20, IP_ACTIVE_LOW, IPT_SERVICE, "Diagnostic Step", KEYCODE_F1, IP_JOY_NONE )
  527.     /* bit 6 is the VG HALT bit. We set it to "low" */
  528.     /* per default (busy vector processor). */
  529.     PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  530.     /* bit 7 is tied to a 3khz clock */
  531.     PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  532.  
  533.     PORT_START    /* DSW0 */
  534.     PORT_DIPNAME(0x03, 0x01, DEF_STR( Lives ) )
  535.     PORT_DIPSETTING (  0x01, "3" )
  536.     PORT_DIPSETTING (  0x00, "4" )
  537.     PORT_DIPSETTING (  0x03, "5" )
  538.     PORT_DIPSETTING (  0x02, "6" )
  539.     PORT_DIPNAME(0x0c, 0x00, DEF_STR( Difficulty ) )
  540.     PORT_DIPSETTING (  0x04, "Easy" )
  541.     PORT_DIPSETTING (  0x00, "Normal" )
  542.     PORT_DIPSETTING (  0x0c, "Medium" )
  543.     PORT_DIPSETTING (  0x08, "Hard" )
  544.     PORT_DIPNAME(0x30, 0x00, "Language" )
  545.     PORT_DIPSETTING (  0x00, "English" )
  546.     PORT_DIPSETTING (  0x10, "German" )
  547.     PORT_DIPSETTING (  0x20, "French" )
  548.     PORT_DIPSETTING (  0x30, "Spanish" )
  549.     PORT_DIPNAME(0xc0, 0x00, DEF_STR( Bonus_Life ) )
  550.     PORT_DIPSETTING (  0xc0, "8000" )
  551.     PORT_DIPSETTING (  0x00, "10000" )
  552.     PORT_DIPSETTING (  0x40, "15000" )
  553.     PORT_DIPSETTING (  0x80, "None" )
  554.  
  555.     PORT_START    /* DSW1 */
  556.     PORT_DIPNAME(0x03, 0x00, DEF_STR( Coinage ) )
  557.     PORT_DIPSETTING (  0x01, DEF_STR( 2C_1C ) )
  558.     PORT_DIPSETTING (  0x00, DEF_STR( 1C_1C ) )
  559.     PORT_DIPSETTING (  0x03, DEF_STR( 1C_2C ) )
  560.     PORT_DIPSETTING (  0x02, DEF_STR( Free_Play ) )
  561.     PORT_DIPNAME(0x0c, 0x00, DEF_STR( Coin_B ) )
  562.     PORT_DIPSETTING (  0x00, "*1" )
  563.     PORT_DIPSETTING (  0x04, "*4" )
  564.     PORT_DIPSETTING (  0x08, "*5" )
  565.     PORT_DIPSETTING (  0x0c, "*6" )
  566.     PORT_DIPNAME(0x10, 0x00, DEF_STR( Coin_A ) )
  567.     PORT_DIPSETTING (  0x00, "*1" )
  568.     PORT_DIPSETTING (  0x10, "*2" )
  569.     PORT_DIPNAME(0xe0, 0x00, "Bonus Coins" )
  570.     PORT_DIPSETTING (  0x00, "None" )
  571.     PORT_DIPSETTING (  0x20, "3 credits/2 coins" )
  572.     PORT_DIPSETTING (  0xa0, "4 credits/3 coins" )
  573.     PORT_DIPSETTING (  0x40, "5 credits/4 coins" )
  574.     PORT_DIPSETTING (  0x60, "6 credits/4 coins" )
  575.     PORT_DIPSETTING (  0x80, "6 credits/6 coins" )
  576.  
  577.     /* See machine/spacduel.c for more info on these 2 ports */
  578.     PORT_START    /* IN3 - Player 1 - spread over 8 memory locations */
  579.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY )
  580.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  581.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  582.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON3 )
  583.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 )
  584.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
  585.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
  586.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
  587.  
  588.     PORT_START    /* IN4 - Player 2 - spread over 8 memory locations */
  589.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_PLAYER2 )
  590.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_PLAYER2 )
  591.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2 )
  592.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER2 )
  593.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_PLAYER2 )
  594.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
  595.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
  596.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
  597. INPUT_PORTS_END
  598.  
  599.  
  600.  
  601. static struct POKEYinterface pokey_interface =
  602. {
  603.     2,    /* 2 chips */
  604.     1500000,    /* 1.5 MHz??? */
  605.     { 50, 50 },
  606.     /* The 8 pot handlers */
  607.     { 0, 0 },
  608.     { 0, 0 },
  609.     { 0, 0 },
  610.     { 0, 0 },
  611.     { 0, 0 },
  612.     { 0, 0 },
  613.     { 0, 0 },
  614.     { 0, 0 },
  615.     /* The allpot handler */
  616.     { input_port_1_r, input_port_2_r },
  617. };
  618.  
  619.  
  620.  
  621. static struct MachineDriver machine_driver_bwidow =
  622. {
  623.     /* basic machine hardware */
  624.     {
  625.         {
  626.             CPU_M6502,
  627.             1500000,    /* 1.5 Mhz */
  628.             bwidow_readmem,bwidow_writemem,0,0,
  629.             interrupt,4    /* 4.1ms */
  630.         }
  631.     },
  632.     60, 0,    /* frames per second, vblank duration (vector game, so no vblank) */
  633.     1,
  634.     0,
  635.  
  636.     /* video hardware */
  637.     400, 300, { 0, 480, 0, 440 },
  638.     0,
  639.     256, 0,
  640.     avg_init_palette_multi,
  641.  
  642.     VIDEO_TYPE_VECTOR,
  643.     0,
  644.     avg_start,
  645.     avg_stop,
  646.     vector_vh_screenrefresh,
  647.  
  648.     /* sound hardware */
  649.     0,0,0,0,
  650.     {
  651.         {
  652.             SOUND_POKEY,
  653.             &pokey_interface
  654.         }
  655.     }
  656. };
  657.  
  658. static struct MachineDriver machine_driver_gravitar =
  659. {
  660.     /* basic machine hardware */
  661.     {
  662.         {
  663.             CPU_M6502,
  664.             1500000,    /* 1.5 Mhz */
  665.             bwidow_readmem,bwidow_writemem,0,0,
  666.             interrupt,4 /* 4.1ms */
  667.         }
  668.     },
  669.     60, 0,    /* frames per second, vblank duration (vector game, so no vblank) */
  670.     1,
  671.     0,
  672.  
  673.     /* video hardware */
  674.     400, 300, { 0, 420, 0, 400 },
  675.     0,
  676.     256, 0,
  677.     avg_init_palette_multi,
  678.  
  679.     VIDEO_TYPE_VECTOR,
  680.     0,
  681.     avg_start,
  682.     avg_stop,
  683.     vector_vh_screenrefresh,
  684.  
  685.     /* sound hardware */
  686.     0,0,0,0,
  687.     {
  688.         {
  689.             SOUND_POKEY,
  690.             &pokey_interface
  691.         }
  692.     },
  693.  
  694.     atari_vg_earom_handler
  695. };
  696.  
  697. static struct MachineDriver machine_driver_spacduel =
  698. {
  699.     /* basic machine hardware */
  700.     {
  701.         {
  702.             CPU_M6502,
  703.             1500000,    /* 1.5 Mhz */
  704.             spacduel_readmem,spacduel_writemem,0,0,
  705.             interrupt,4 /* 5.4ms */
  706.         }
  707.     },
  708.     45, 0,    /* frames per second, vblank duration (vector game, so no vblank) */
  709.     1,
  710.     0,
  711.  
  712.     /* video hardware */
  713.     400, 300, { 0, 540, 0, 400 },
  714.     0,
  715.     256, 0,
  716.     avg_init_palette_multi,
  717.  
  718.     VIDEO_TYPE_VECTOR,
  719.     0,
  720.     avg_start,
  721.     avg_stop,
  722.     vector_vh_screenrefresh,
  723.  
  724.     /* sound hardware */
  725.     0,0,0,0,
  726.     {
  727.         {
  728.             SOUND_POKEY,
  729.             &pokey_interface
  730.         }
  731.     },
  732.  
  733.     atari_vg_earom_handler
  734. };
  735.  
  736.  
  737.  
  738. /***************************************************************************
  739.  
  740.   Game driver(s)
  741.  
  742. ***************************************************************************/
  743.  
  744. ROM_START( bwidow )
  745.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  746.     /* Vector ROM */
  747.     ROM_LOAD( "136017.107",   0x2800, 0x0800, 0x97f6000c )
  748.     ROM_LOAD( "136017.108",   0x3000, 0x1000, 0x3da354ed )
  749.     ROM_LOAD( "136017.109",   0x4000, 0x1000, 0x2fc4ce79 )
  750.     ROM_LOAD( "136017.110",   0x5000, 0x1000, 0x0dd52987 )
  751.     /* Program ROM */
  752.     ROM_LOAD( "136017.101",   0x9000, 0x1000, 0xfe3febb7 )
  753.     ROM_LOAD( "136017.102",   0xa000, 0x1000, 0x10ad0376 )
  754.     ROM_LOAD( "136017.103",   0xb000, 0x1000, 0x8a1430ee )
  755.     ROM_LOAD( "136017.104",   0xc000, 0x1000, 0x44f9943f )
  756.     ROM_LOAD( "136017.105",   0xd000, 0x1000, 0xa046a2e2 )
  757.     ROM_LOAD( "136017.106",   0xe000, 0x1000, 0x4dc28b22 )
  758.     ROM_RELOAD(              0xf000, 0x1000 )    /* for reset/interrupt vectors */
  759. ROM_END
  760.  
  761. ROM_START( gravitar )
  762.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  763.     /* Vector ROM */
  764.     ROM_LOAD( "136010.210",   0x2800, 0x0800, 0xdebcb243 )
  765.     ROM_LOAD( "136010.207",   0x3000, 0x1000, 0x4135629a )
  766.     ROM_LOAD( "136010.208",   0x4000, 0x1000, 0x358f25d9 )
  767.     ROM_LOAD( "136010.309",   0x5000, 0x1000, 0x4ac78df4 )
  768.     /* Program ROM */
  769.     ROM_LOAD( "136010.301",   0x9000, 0x1000, 0xa2a55013 )
  770.     ROM_LOAD( "136010.302",   0xa000, 0x1000, 0xd3700b3c )
  771.     ROM_LOAD( "136010.303",   0xb000, 0x1000, 0x8e12e3e0 )
  772.     ROM_LOAD( "136010.304",   0xc000, 0x1000, 0x467ad5da )
  773.     ROM_LOAD( "136010.305",   0xd000, 0x1000, 0x840603af )
  774.     ROM_LOAD( "136010.306",   0xe000, 0x1000, 0x3f3805ad )
  775.     ROM_RELOAD(              0xf000, 0x1000 )    /* for reset/interrupt vectors */
  776. ROM_END
  777.  
  778. ROM_START( gravitr2 )
  779.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  780.     /* Vector ROM */
  781.     ROM_LOAD( "136010.210",   0x2800, 0x0800, 0xdebcb243 )
  782.     ROM_LOAD( "136010.207",   0x3000, 0x1000, 0x4135629a )
  783.     ROM_LOAD( "136010.208",   0x4000, 0x1000, 0x358f25d9 )
  784.     ROM_LOAD( "136010.209",   0x5000, 0x1000, 0x37034287 )
  785.     /* Program ROM */
  786.     ROM_LOAD( "136010.201",   0x9000, 0x1000, 0x167315e4 )
  787.     ROM_LOAD( "136010.202",   0xa000, 0x1000, 0xaaa9e62c )
  788.     ROM_LOAD( "136010.203",   0xb000, 0x1000, 0xae437253 )
  789.     ROM_LOAD( "136010.204",   0xc000, 0x1000, 0x5d6bc29e )
  790.     ROM_LOAD( "136010.205",   0xd000, 0x1000, 0x0db1ff34 )
  791.     ROM_LOAD( "136010.206",   0xe000, 0x1000, 0x4521ca48 )
  792.     ROM_RELOAD(              0xf000, 0x1000 )    /* for reset/interrupt vectors */
  793. ROM_END
  794.  
  795. ROM_START( spacduel )
  796.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  797.     /* Vector ROM */
  798.     ROM_LOAD( "136006.106",   0x2800, 0x0800, 0x691122fe )
  799.     ROM_LOAD( "136006.107",   0x3000, 0x1000, 0xd8dd0461 )
  800.     /* Program ROM */
  801.     ROM_LOAD( "136006.201",   0x4000, 0x1000, 0xf4037b6e )
  802.     ROM_LOAD( "136006.102",   0x5000, 0x1000, 0x4c451e8a )
  803.     ROM_LOAD( "136006.103",   0x6000, 0x1000, 0xee72da63 )
  804.     ROM_LOAD( "136006.104",   0x7000, 0x1000, 0xe41b38a3 )
  805.     ROM_LOAD( "136006.105",   0x8000, 0x1000, 0x5652710f )
  806.     ROM_RELOAD(              0x9000, 0x1000 )
  807.     ROM_RELOAD(              0xa000, 0x1000 )
  808.     ROM_RELOAD(              0xb000, 0x1000 )
  809.     ROM_RELOAD(              0xc000, 0x1000 )
  810.     ROM_RELOAD(              0xd000, 0x1000 )
  811.     ROM_RELOAD(              0xe000, 0x1000 )
  812.     ROM_RELOAD(              0xf000, 0x1000 )    /* for reset/interrupt vectors */
  813. ROM_END
  814.  
  815.  
  816.  
  817. GAME( 1982, bwidow,   0,        bwidow,   bwidow,   0, ROT0, "Atari", "Black Widow" )
  818. GAME( 1982, gravitar, 0,        gravitar, gravitar, 0, ROT0, "Atari", "Gravitar (version 3)" )
  819. GAME( 1982, gravitr2, gravitar, gravitar, gravitar, 0, ROT0, "Atari", "Gravitar (version 2)" )
  820. GAME( 1980, spacduel, 0,        spacduel, spacduel, 0, ROT0, "Atari", "Space Duel" )
  821.